<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title th:fragment="title" th:text="(${#bools.isTrue(isNew)} ? 'Add' : 'Edit') + ' Page Check Point'" >Title</title>
		<th:block th:fragment="header">
		</th:block>
    </head>
    <body>
        <div th:fragment="content">
			<div class="col-md-12 center-block">
				<form th:action="@{/subscription/checkpoint/edit}" th:object="${point}" method="post" class="form-horizontal" role="form">
					<input type="hidden" util:idPre="point-" th:field="*{id}" />
					<div class="form-group">
						<label for="point-name" class="col-md-3 control-label">Name</label>
						<div class="col-md-4">
							<input type="text" util:idPre="point-" th:field="*{name}" class="form-control" placeholder="Name" />
						</div>
					</div>
					<div class="form-group">
						<label for="point-selector" class="col-md-3 control-label">Selector</label>
						<div class="col-md-9">
							<input type="text" util:idPre="point-" th:field="*{selector}" class="form-control" placeholder="Selector" />
						</div>
					</div>
					<div class="form-group">
						<label for="point-type" class="col-md-3 control-label">Type</label>
						<div class="col-md-2">
							<input type="text" util:idPre="point-" th:field="*{type}" class="form-control" placeholder="Type" />
						</div>
					</div>
					<div class="form-group">
						<label for="point-order" class="col-md-3 control-label">Order</label>
						<div class="col-md-2">
							<input type="text" util:idPre="point-" th:field="*{order}" class="form-control" placeholder="Order" />
						</div>
					</div>
					<div class="form-group">
						<label for="point-subscription.id" class="col-md-3 control-label">Belong To</label>
						<div class="col-md-6">
							<select th:field="*{subscription.id}" class="form-control">
								<option th:each="subscription : ${subscriptions}" th:value="${subscription.id}" th:text="${subscription.name}">Subscription Name</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-3 col-md-offset-3">
							<div class="checkbox">
								<input type="hidden" name="enabled" th:value="(*{enabled} or ${isNew})? true : false" />
								<input id="point-enabled" type="checkbox" th:checked="*{enabled} or ${isNew}" />
								<label for="point-enabled">Enabled</label>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-3 col-md-offset-3">
							<button class="btn btn-md btn-primary" type="submit" th:text="${#bools.isTrue(isNew)} ? 'Add' : 'Edit'">Edit</button>
							<button class="btn btn-md btn-primary col-md-offset-1" type="reset">Reset</button>
						</div>
					</div>
				</form>
			</div>
        </div>
		<th:block th:fragment="script">
			<script th:src="@{/assets/js/page/subscription/point/edit.js}" type="text/javascript"></script>
			<script th:src="@{/assets/js/share/boolCheckbox.js}" type="text/javascript"></script>
		</th:block>
    </body>
</html>